def produce():
    print("PRODUCE")
    for i in range(8):
        print("produce %d" % i)
        yield i

def consume():
    print("\tCONSUME")
    for i in range(8):
        x = next(coro_p)
        print("\tconsume %d" % x)

coro_p = produce()
consume()

    
